load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss")
load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("scm_server_infra")

rust_library(
    name = "mononoke_app",
    srcs = glob(["src/**/*.rs"]),
    named_deps = {
                     "slog": "//common/rust/shed/tracing_slog_compat:tracing_slog_compat",
                 } |
                 ({} if rust_oss.is_oss_build() else {
                     "MononokeAppStats_ods3_types": "//eden/mononoke/facebook/ods3_schemas:MononokeAppStats_ods3-rust",
                 }),
    deps = ([
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:async-trait",
        "fbsource//third-party/rust:tracing",
        "fbsource//third-party/rust:clap",
        "fbsource//third-party/rust:futures",
        "fbsource//third-party/rust:futures-util",
        "fbsource//third-party/rust:itertools",
        "fbsource//third-party/rust:regex",
        "fbsource//third-party/rust:strum",
        "fbsource//third-party/rust:tokio",
        "//common/rust/gflags:gflags",
        "//common/rust/ratelim:ratelim",
        "//common/rust/shed/cached_config:cached_config",
        "//common/rust/shed/facet:facet",
        "//common/rust/shed/fbinit:fbinit",
        "//common/rust/shed/justknobs_stub:justknobs",
        "//common/rust/shed/memcache_stub:memcache",
        "//common/rust/shed/services:services",
        "//common/rust/shed/stats:stats",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
        "//eden/mononoke/blobstore:blobstore",
        "//eden/mononoke/blobstore:blobstore_factory",
        "//eden/mononoke/blobstore:redactedblobstore",
        "//eden/mononoke/bonsai_git_mapping:bonsai_git_mapping",
        "//eden/mononoke/bonsai_globalrev_mapping:bonsai_globalrev_mapping",
        "//common/rust/shed/futures_retry:futures_retry",
        "//eden/mononoke/bonsai_hg_mapping:bonsai_hg_mapping",
        "//eden/mononoke/bonsai_svnrev_mapping:bonsai_svnrev_mapping",
        "//eden/mononoke/bookmarks:bookmarks",
        "//eden/mononoke/cmdlib:arg_extensions",
        "//eden/mononoke/cmdlib:cmdlib_logging",
        "//eden/mononoke/cmdlib:environment",
        "//eden/mononoke/cmdlib/base_app:base_app",
        "//eden/mononoke/cmdlib/caching:cmdlib_caching",
        "//eden/mononoke/cmdlib/commit_id:commit_id",
        "//eden/mononoke/cmdlib/config_args:config_args",
        "//eden/mononoke/cmdlib/mononoke_app/shutdown_timeout:shutdown_timeout",
        "//eden/mononoke/cmdlib/mononoke_app/tls:tls",
        "//eden/mononoke/common/rendezvous:rendezvous",
        "//eden/mononoke/common/running:running",
        "//eden/mononoke/common/rust/sql_ext:sql_ext",
        "//eden/mononoke/common/scuba_ext:scuba_ext",
        "//eden/mononoke/derived_data:derived_data_remote",
        "//eden/mononoke/facebook/fb303_prometheus_exporter:fb303_prometheus_exporter",
        "//eden/mononoke/megarepo_api:megarepo_config",
        "//eden/mononoke/metaconfig:metaconfig_parser",
        "//eden/mononoke/metaconfig:metaconfig_types",
        "//eden/mononoke/mononoke_api:mononoke_api",
        "//eden/mononoke/mononoke_configs:mononoke_configs",
        "//eden/mononoke/mononoke_repos:mononoke_repos",
        "//eden/mononoke/mononoke_types:mononoke_types",
        "//eden/mononoke/permission_checker:permission_checker",
        "//eden/mononoke/repo_attributes/repo_blobstore:repo_blobstore",
        "//eden/mononoke/repo_attributes/commit_graph/commit_graph_types:commit_graph_types",
        "//eden/mononoke/repo_factory:repo_factory",
        "//eden/mononoke/server/context:context",
        "//eden/scm/lib/clientinfo:clientinfo",
    ] + ([] if rust_oss.is_oss_build() else [
        "//eden/mononoke/facebook/ods3_schemas:MononokeAppStats_ods3-rs_bindings",
    ])),
)
